package net.xdclass.rpc.pay;

import net.xdclass.util.JsonData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Administrator
 * @description
 * @since 2023-07-03 23:01
 */
@Component
@FeignClient("dcloud-pay")
public interface WxPayFeign {

    /**
     * 根据商户id 和 订单流水查询支付状态
     * @param merid
     * @param outTradeNo
     * @return
     */
    @GetMapping("/v3/pay/transactions/status")
    JsonData queryOrderStatus(@RequestParam("mchid") String merid,
                                     @RequestParam("out_trade_no") String outTradeNo);

    /**
     * 关闭订单
     * @param merid
     * @param outTradeNo
     * @return
     */
    @GetMapping("/v3/pay/transactions/close")
    JsonData closeOrderStatus(@RequestParam("mchid") String merid,
                                     @RequestParam("out_trade_no") String outTradeNo);
}
